package com.yzy.singleton;

/**
 * 静态内部类
 * 第一次get的时候才会初始化
 */
public class Singleton02 {

    private Singleton02() {}

    private static class SingletonHolder {
        private static final Singleton02 instance = new Singleton02();
    }

    public static Singleton02 getInstance() {
        return SingletonHolder.instance;
    }

}
